CREATE EXTERNAL TABLE jms_dm.dm_cn_export_diff_weight_sum_dt(
  scan_date date COMMENT '日期',
  pick_network_code string COMMENT '网点编码',
  pick_network_name string COMMENT '网点名称',
  subordinate_agent_code string COMMENT '所属代理区编码',
  subordinate_agent_name string COMMENT '所属代理区名称',
  franchisee_code string COMMENT '所属加盟商编码',
  franchisee_name string COMMENT '所属加盟商名称',
  first_center_code string COMMENT '始发中心编码',
  first_center_name string COMMENT '始发中心名称',
  weight_qty int COMMENT '中心称重票量',
  diff1_qty int COMMENT '称重差异票数1',
  diff1_wty decimal(13,2) COMMENT '累计差异重量1',
  zero_half_1 int COMMENT '0-0.5kg票数1',
  half_one_1 int COMMENT '0.5-1kg票数1',
  one_three_1 int COMMENT '1-3kg票数1',
  three_five_1 int COMMENT '3-5kg票数1',
  than_five_1 int COMMENT '大于5kg票数1',
  diff2_qty int COMMENT '称重差异票数2',
  diff2_wty decimal(13,2) COMMENT '累计差异重量2',
  zero_half_2 int COMMENT '0-0.5kg票数2',
  half_one_2 int COMMENT '0.5-1kg票数2',
  one_three_2 int COMMENT '1-3kg票数2',
  three_five_2 int COMMENT '3-5kg票数2',
  than_five_2 int COMMENT '大于5kg票数2',
  diff3_qty int COMMENT '称重差异票数3',
  diff3_wty decimal(13,2) COMMENT '累计差异重量3',
  zero_half_3 int COMMENT '0-0.5kg票数3',
  half_one_3 int COMMENT '0.5-1kg票数3',
  one_three_3 int COMMENT '1-3kg票数3',
  three_five_3 int COMMENT '3-5kg票数3',
  than_five_3 int COMMENT '大于5kg票数3',
  diff4_qty int COMMENT '称重差异票数4',
  diff4_wty decimal(13,2) COMMENT '累计差异重量4',
  zero_half_4 int COMMENT '0-0.5kg票数4',
  half_one_4 int COMMENT '0.5-1kg票数4',
  one_three_4 int COMMENT '1-3kg票数4',
  three_five_4 int COMMENT '3-5kg票数4',
  than_five_4 int COMMENT '大于5kg票数4',
  weight_ot bigint COMMENT "中心应称重票数"
 )
 COMMENT '称重差异汇总'
 PARTITIONED BY (dt string COMMENT '日期(yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_dm.db/external/dm_cn_export_diff_weight_sum_dt'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );
